@import plugins.Context
@import org.silkframework.workspace.activity.workflow.Workflow
@import controllers.workflow.routes.Assets
@import controllers.core.routes.{Assets => CoreAssets}
@import views.html.workspace.activity.taskActivityControl
@import org.silkframework.workspace.activity.workflow.OldWorkflowExecutor
@import models.workflow.WorkflowConfig

@(context: Context[Workflow])(implicit session: play.api.mvc.Session)

@header = {
  <link type="text/css" href="@Assets.at("editor/editor.css")" rel="stylesheet" />

  <script type="text/javascript" src="@CoreAssets.at("libs/jsplumb/jsPlumb-2.1.8-min.js")"></script>
  <script type="text/javascript" src="@CoreAssets.at("libs/dynep/dynep.js")"></script>
  <script type="text/javascript" src="@Assets.at("editor/editor.js")"></script>
  <script type="text/javascript" src="@Assets.at("editor/serializeWorkflow.js")"></script>

  <script type="text/javascript">
    var apiUrl = '@config.baseUrl/workflow/workflows/@context.project.name/@context.task.id';
    var workflowId = '@context.task.id';
    var editor = null;
  </script>
}

@toolbar = {
<ul>
  <li>
    <button class="mdl-button mdl-js-button mdl-button--raised" onclick="commitWorkflow()" >Save</button>
  </li>
  <li>
    <div class="spacer"/>
  </li>
  <li>
    @taskActivityControl(context.task.activity(WorkflowConfig.executorName), showButtons = true)
  </li>
</ul>
}

@content = {
@toolbox(context.project)

<div id="editorContent" style="position: relative;" class="mdl-shadow--2dp">
</div>
}

@main(Some(context))(header)(toolbar)(content)